package net.aiform.entity.security;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import net.aiform.entity.IdEntity;


/**
 * Authority entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "authority")
public class Authority  extends IdEntity {

	// Fields

	private Module module;
	private String authName;
	private String comeFrom;
	private String authStyle;
	private String displayPage;
	private Integer needAuth;
	private Integer authSequence;
	private String authUrl;
	private String authType;
	private Set<Sysrole> sysroles = new HashSet<Sysrole>(0);

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MOD_ID")
	public Module getModule() {
		return this.module;
	}

	public void setModule(Module module) {
		this.module = module;
	}

	@Column(name = "AUTH_NAME", length = 32)
	public String getAuthName() {
		return this.authName;
	}

	public void setAuthName(String authName) {
		this.authName = authName;
	}

	@Column(name = "COME_FROM", length = 500)
	public String getComeFrom() {
		return this.comeFrom;
	}

	public void setComeFrom(String comeFrom) {
		this.comeFrom = comeFrom;
	}

	@Column(name = "AUTH_STYLE", length = 100)
	public String getAuthStyle() {
		return this.authStyle;
	}

	public void setAuthStyle(String authStyle) {
		this.authStyle = authStyle;
	}

	@Column(name = "DISPLAY_PAGE", length = 500)
	public String getDisplayPage() {
		return this.displayPage;
	}

	public void setDisplayPage(String displayPage) {
		this.displayPage = displayPage;
	}

	@Column(name = "NEED_AUTH")
	public Integer getNeedAuth() {
		return this.needAuth;
	}

	public void setNeedAuth(Integer needAuth) {
		this.needAuth = needAuth;
	}

	@Column(name = "AUTH_SEQUENCE")
	public Integer getAuthSequence() {
		return this.authSequence;
	}

	public void setAuthSequence(Integer authSequence) {
		this.authSequence = authSequence;
	}

	@Column(name = "AUTH_URL", length = 500)
	public String getAuthUrl() {
		return this.authUrl;
	}

	public void setAuthUrl(String authUrl) {
		this.authUrl = authUrl;
	}

	@Column(name = "AUTH_TYPE", length = 10)
	public String getAuthType() {
		return this.authType;
	}

	public void setAuthType(String authType) {
		this.authType = authType;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "authorities")
	public Set<Sysrole> getSysroles() {
		return this.sysroles;
	}

	public void setSysroles(Set<Sysrole> sysroles) {
		this.sysroles = sysroles;
	}

}